﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class LetterMenuEvents : MonoBehaviour
{
    public TextAsset Letter_01, Letter_02, Letter_03;
    public Text ShowLetterTextUI;
    string letter_01, letter_02, letter_03;
    private void Awake()
    {
        letter_01 = Letter_01.text;
        letter_02 = Letter_02.text;
        letter_03 = Letter_03.text;
        transform.GetChild(0).GetComponent<Button>().interactable = GlobalData.LetterCanbeReads[0];
        transform.GetChild(1).GetComponent<Button>().interactable = GlobalData.LetterCanbeReads[1];
        transform.GetChild(2).GetComponent<Button>().interactable = GlobalData.LetterCanbeReads[2];
    }
    public void Letter01()
    {
        ShowLetterTextUI.text = letter_01;
        gameObject.SetActive(false);
        ShowLetterTextUI.transform.parent.gameObject.SetActive(true);
    }
    public void Letter02()
    {
        ShowLetterTextUI.text = letter_02;
        gameObject.SetActive(false);
        ShowLetterTextUI.transform.parent.gameObject.SetActive(true);
    }
    public void Letter03()
    {
        ShowLetterTextUI.text = letter_03;
        gameObject.SetActive(false);
        ShowLetterTextUI.transform.parent.gameObject.SetActive(true);
    }
}
